#!/bin/sh
(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix

basedir=`dirname "$0"`

case `uname` in
    *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac

if [ -x "$basedir/node.exe" ]; then
  "$basedir/node.exe" "$basedir/../lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "$@"
  ret=$?
else
  node "$basedir/../lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "$@"
  ret=$?
fi
exit $ret
